/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.hibernate.dao.SysCateAttributeDao;
import com.scpii.universal.hibernate.entity.SysCateAttributeTab;

/**
 * genericWeb
 * @author weny
 * 2012-7-6上午11:05:49
 */
@Repository
public class SysCateAttributeDaoImpl extends BaseDaoImpl<SysCateAttributeTab, Integer> implements
		SysCateAttributeDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<SysCateAttributeTab> getAttributeByCateId(int id) {
		String hql = "select new SysCateAttributeTab(s.intAttributeId,s.varAttributeName) "
			+ "from SysCateAttributeTab s where s.intDeleteSign=? and s.intSysCateId=?";
		return getHibernateTemplate().getSessionFactory().getCurrentSession()
				.createQuery(hql).setParameter(0,
						GenericConstants.DELETE_SIGN_EXIST).setParameter(1, id).list();
	}
}
